package com.dhnsoft.boot3.ssm.controller;

import com.dhnsoft.boot3.ssm.bean.TUser;
import com.dhnsoft.boot3.ssm.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dhn
 * @version 1.0
 * @date 2023-09-04 14:00
 * @Desc
 */
@RestController
public class UserController {

    @Autowired
    UserMapper userMapper;

    @GetMapping("/user/{id}")
    public TUser getUser(@PathVariable("id") Long id){
        TUser userById = userMapper.getUserById(id);
        return userById;
    }

}
